from django.contrib import admin
from django.http import HttpResponse
from django.urls import path, register_converter,re_path

from apps.users import views
from utils.converters import UsernameConverter

register_converter(UsernameConverter,'uname')

urlpatterns = [
    path('usernames/<uname:username>/count/', views.UsernameCountView.as_view()),
    path('register/', views.RegisterView.as_view()),
    path('login/', views.LoginView.as_view()),
    path('logout/', views.LogoutView.as_view()),
    path('info/', views.UserInfoView.as_view()),
    path('emails/', views.SaveEmailView.as_view()),
    path('emails/verification/', views.VerifyEmailView.as_view()),
    path('password/', views.PasswordView.as_view()),
    path('addresses/create/', views.AddressCreateView.as_view()),
    path('addresses/', views.AddressView.as_view()),
    # ?P分组 可以用address_id取
    re_path('addresses/(?P<address_id>\d+)/', views.AddressRemoveView.as_view()),


]



